public class Demo4 {

    public static int sum (int a,int b){
        return  a + b;
    }

    public static int  sum (int a,int b,int c){
        return a + b + c;
    }

    public static double sum (double a,double b){
        return a + b;
    }


    public static void main(String[] args) {

        int num1 = sum(2,3); // 调用 sum(int a, int b)方法
        int num2 = sum(2,3,4); // 调用 sum(int a, int b,int c)方法
        double num3 = sum(3.333,6.666); // 调用 sum(double a, double b)方法

        System.out.println(num1);
        System.out.println(num2);
        System.out.println(num3);

    }
}
